package Tween
{
	import Plugin.TweenObjectPlugin;
	import Plugin.TweenPlugin;
	
	import flash.geom.Rectangle;

	public class ScrollTween extends TweenObjectPlugin
	{
		public var width:Number=0;
		public var height:Number=0;
		
		public var startX:Number = 0;
		public var startY:Number = 0;
		
		public var endX:Number=0;
		public var endY:Number=0;
		
		public var scrollRect:Rectangle;
		
		public function ScrollTween()
		{
			super();
			scrollRect=new Rectangle();
		}
		
		override protected function _update():void
		{
			if(time==0)return;
			
			scrollRect.width=width;
			scrollRect.height=height;
			
			scrollRect.x=easeing(time,startX,endX-startX,duration);
			scrollRect.y=easeing(time,startY,endY-startY,duration);
			
			go.obj.scrollRect=scrollRect;
		}
	}
}